<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .value {
                width: 1000px;
            }
        </style>
    </ui:define>
    
    <ui:define name="title">
        Schedule - <span class="subitem">Basic</span>
    </ui:define>

    <ui:define name="description">
        <p>
            Schedule provides an Outlook, iCal like JSF component to manage events which is based on FullCalendar. Schedule is highly customizable featuring various views (month, day, week), built-in I18N, drag-drop, resize, customizable event dialog, ajax listeners for every user interaction and more.
        </p>
        <p>
            This Schedule is editable.
        </p>
    </ui:define>

    <ui:param name="documentationLink" value="/components/schedule" />

    <ui:define name="implementation">

        <h:form>
            <p:growl id="messages" showDetail="true" />
     
            <h:panelGrid columnClasses="value">
                <p:schedule id="schedule" value="#{scheduleJava8View.eventModel}" widgetVar="myschedule" >

                    <p:ajax event="dateSelect" listener="#{scheduleJava8View.onDateSelect}" update="eventDetails" oncomplete="PF('eventDialog').show();" />
                    <p:ajax event="eventSelect" listener="#{scheduleJava8View.onEventSelect}" update="eventDetails" oncomplete="PF('eventDialog').show();" />
                    <p:ajax event="eventMove" listener="#{scheduleJava8View.onEventMove}" update="messages" />
                    <p:ajax event="eventResize" listener="#{scheduleJava8View.onEventResize}" update="messages" />

                </p:schedule>
            </h:panelGrid>
            
            <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">
                <h:panelGrid id="eventDetails" columns="2">
                    <p:outputLabel for="title" value="Titles:" />
                    <p:inputText id="title" value="#{scheduleJava8View.event.title}" required="true" />

                    <p:outputLabel for="from" value="From:" />
                    <p:datePicker id="from" value="#{scheduleJava8View.event.startDate}" pattern="dd/MM/yyyy" showTime="true" appendTo="@(body)"  />

                    <p:outputLabel for="to" value="To:" />
                    <p:datePicker id="to" value="#{scheduleJava8View.event.endDate}" pattern="dd/MM/yyyy" showTime="true" appendTo="@(body)" />

                    <p:outputLabel for="allDay" value="All Day (see #1164):" />
                    <h:selectBooleanCheckbox id="allDay" value="#{scheduleJava8View.event.allDay}" />

                    <p:commandButton type="reset" value="Reset" />
                    <p:commandButton id="addButton" value="Save" action="#{scheduleJava8View.addEvent}" oncomplete="PF('myschedule').update();PF('eventDialog').hide();" />
                </h:panelGrid>
            </p:dialog>    
        </h:form>
        
    </ui:define>

</ui:composition>
